/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * JDialogAverages.java
 *
 * Created on 09/07/2010, 17:22:10
 */

package systole.view.averages;

import systole.utils.ImageUtils;

/**
 *
 * @author jmj
 */
public class JDialogAverages extends javax.swing.JDialog {

    /**
	 * 
	 */
	private static final long serialVersionUID = -7888993552358328018L;
	private ControllerAverageView controller;

    /** Creates new form JDialogAverages 
     * @param parent 
     * @param controller */
    public JDialogAverages(java.awt.Frame parent,ControllerAverageView controller) {
        super(parent, true);
        initComponents();
        this.controller= controller;
        this.setIconImage(ImageUtils.buildImage("resources/icons/average/average16.png"));
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane1 = new javax.swing.JScrollPane();
        jXTableAverages = new org.jdesktop.swingx.JXTable();
        jBtnClose = new javax.swing.JButton();
        jXHeader1 = new org.jdesktop.swingx.JXHeader();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(systole.view.SystoleApp.class).getContext().getResourceMap(JDialogAverages.class);
        setTitle(resourceMap.getString("Form.title")); // NOI18N
        setName("Form"); // NOI18N

        jScrollPane1.setName("jScrollPane1"); // NOI18N

        jXTableAverages.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {

            }
        ));
        jXTableAverages.setColumnControlVisible(true);
        jXTableAverages.setEditable(false);
        jXTableAverages.setName("jXTableAverages"); // NOI18N
        jScrollPane1.setViewportView(jXTableAverages);

        jBtnClose.setText(resourceMap.getString("jBtnClose.text")); // NOI18N
        jBtnClose.setToolTipText(resourceMap.getString("jBtnClose.toolTipText")); // NOI18N
        jBtnClose.setName("jBtnClose"); // NOI18N
        jBtnClose.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBtnCloseActionPerformed(evt);
            }
        });

        jXHeader1.setDescription(resourceMap.getString("jXHeader1.description")); // NOI18N
        jXHeader1.setIcon(resourceMap.getIcon("jXHeader1.icon")); // NOI18N
        jXHeader1.setName("jXHeader1"); // NOI18N
        jXHeader1.setTitle(resourceMap.getString("jXHeader1.title")); // NOI18N
        jXHeader1.setTitleFont(jXHeader1.getTitleFont().deriveFont(jXHeader1.getTitleFont().getSize()+10f));

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jBtnClose, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(26, 26, 26)
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 633, Short.MAX_VALUE)))
                .addGap(22, 22, 22))
            .addComponent(jXHeader1, javax.swing.GroupLayout.DEFAULT_SIZE, 681, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addComponent(jXHeader1, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 287, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jBtnClose)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jBtnCloseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnCloseActionPerformed
        this.controller.closeForm();
    }//GEN-LAST:event_jBtnCloseActionPerformed
   
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jBtnClose;
    private javax.swing.JScrollPane jScrollPane1;
    private org.jdesktop.swingx.JXHeader jXHeader1;
    private org.jdesktop.swingx.JXTable jXTableAverages;
    // End of variables declaration//GEN-END:variables

    /**
     * @return the jXTableAverages
     */
    public org.jdesktop.swingx.JXTable getjXTableAverages() {
        return jXTableAverages;
    }

  

}
